/****** Object:  Stored Procedure dbo.CGO_PaymentGet    Script Date: Thursday, March 24, 2011 ******/
IF EXISTS ( SELECT  *
            FROM    dbo.sysobjects
            WHERE   id = OBJECT_ID(N'dbo.CGO_PaymentGet')
                    AND OBJECTPROPERTY(id, N'IsProcedure') = 1 ) 
  DROP PROCEDURE dbo.CGO_PaymentGet
GO

/* -------------------------------------------------------------------------------------
/   PaymentGet
/  ------------------------------------------------------------------------------------- */
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

CREATE PROCEDURE dbo.CGO_PaymentGet
  @PortalID INT ,
  @PaymentID INT
AS 
  SELECT  PaymentID ,
          PortalID ,
          M.UserID ,
          U.Username,
          Amount ,
          M.StatusID ,
          S.StatusDesc AS PaymentStatus,
          EnrollmentID ,
          CreatedDate ,
          LastUpdateDate
  FROM    dbo.CGO_Payment M
  LEFT JOIN dbo.Users U ON M.UserID = U.UserID
  LEFT JOIN dbo.CGO_PaymentStatus S ON M.StatusID = S.StatusID
  WHERE   PortalID = @PortalID
          AND PaymentID = @PaymentID
	
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
